
@font-face {
    font-family: 'iransans';
    src: url('../../../../Fonts/IRANSansWeb.woff2') format('woff2'),
    url('../../../../Fonts/iransansweb.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ── Root Variables ── */
:root {
    --brand-blue:  #3D63A8;
    --brand-blue-light: #6B92D7;
    --brand-blue-soft: rgba(61, 99, 168, 0.1);
    --brand-blue-glow: rgba(61, 99, 168, 0.25);
    --body-bg:     #dee3ea;
    --surface:     #ffffff;
    --on-surface:  #282f37;
    --text-secondary: #6b7280;
    --text-hint:   #9ca3af;
    --border:      #d1d5db;
    --border-focus: #3D63A8;
    --error:       #d32f2f;
    --error-bg:    #ffebee;
    --radius-sm:   8px;
    --radius-md:   12px;
    --radius-lg:   20px;
}

/* ── Body ── */
html, body {
    height: 100%;
}
body {
    font-family: 'iransans', Tahoma, sans-serif;
    background: var(--body-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--on-surface);
    padding: 16px;
    font-size: 12px;
}

/* ═══════════════════════════════════════════
   MINIMAL BRAND BAR
   ═══════════════════════════════════════════ */

.brand-bar {
    margin-bottom: 12px;
}
.brand-bar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.4;
}
.brand-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-blue);
}
.brand-sub {
    font-size: 11px;
    color: var(--text-hint);
    font-weight: 400;
}

/* ═══════════════════════════════════════════
   LOGIN CARD
   ═══════════════════════════════════════════ */

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px 24px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
}

.card-header {
    text-align: center;
    margin-bottom: 24px;
}
.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--on-surface);
    margin-bottom: 4px;
}
.card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ═══════════════════════════════════════════
   FORM FIELDS
   ═══════════════════════════════════════════ */

.field {
    margin-bottom: 16px;
}

.field-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-input-wrap input {
    width: 100%;
    padding: 14px 44px 14px 44px;
    font-size: 13px;
    font-family: 'iransans', Tahoma, sans-serif;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    background: #f9fafb;
    color: var(--on-surface);
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.field-input-wrap input::placeholder {
    color: var(--text-hint);
    font-weight: 400;
    font-size: 12px;
}

.field-input-wrap input:focus {
    border-color: var(--border-focus);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--brand-blue-soft);
}

/* ── Field icons (left side) ── */
.field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-hint);
    pointer-events: none;
    transition: color 0.2s ease;
    flex-shrink: 0;
}
.field-input-wrap:focus-within .field-icon {
    color: var(--border-focus);
}

/* ── Password toggle (left side, replaces field-icon) ── */
.toggle-password {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-hint);
    border: none;
    background: none;
    padding: 0;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
}
.toggle-password:active { background: var(--brand-blue-soft); }
.toggle-password svg {
    width: 18px;
    height: 18px;
    position: absolute;
    transition: opacity 0.2s ease;
}
.toggle-password .eye-closed { opacity: 0; }
.toggle-password.visible .eye-open  { opacity: 0; }
.toggle-password.visible .eye-closed { opacity: 1; }

/* ═══════════════════════════════════════════
   SUBMIT BUTTON
   ═══════════════════════════════════════════ */

.btn-submit {
    width: 100%;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'iransans', Tahoma, sans-serif;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-light));
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 3px 10px var(--brand-blue-glow);
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    overflow: hidden;
}
.btn-submit:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px var(--brand-blue-glow);
}
.btn-submit:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

/* ═══════════════════════════════════════════
   FORGOT PASSWORD
   ═══════════════════════════════════════════ */

.forgot-password {
    text-align: center;
    margin-top: 16px;
}
.forgot-password a {
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 400;
    padding: 6px 4px;
    display: inline-block;
    transition: color 0.2s ease;
}
.forgot-password a:active { color: var(--brand-blue); }

/* ═══════════════════════════════════════════
   ERROR MESSAGE
   ═══════════════════════════════════════════ */

.board-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    text-align: center;
    display: none;
    font-weight: 400;
}
.board-message.error {
    background: #d32f2f;
    color: #fff;
    border: 1px solid #b71c1c;
}
.board-message.show { display: none; }

/* ═══════════════════════════════════════════
   CARD FOOTER
   ═══════════════════════════════════════════ */

.card-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}
.card-footer p {
    font-size: 10px;
    color: var(--text-hint);
    font-weight: 300;
    line-height: 1.6;
}
.card-footer-copy {
    direction: ltr;
}

/* ═══════════════════════════════════════════
   LOADING SPINNER
   ═══════════════════════════════════════════ */

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-submit.loading .btn-text { display: none; }
.btn-submit.loading .spinner { display: block; }

/* ═══════════════════════════════════════════
   HIDDEN FIELDS
   ═══════════════════════════════════════════ */

.hidden-fields { display: none; }

/* ═══════════════════════════════════════════
   VERY SMALL SCREENS (<360px)
   ═══════════════════════════════════════════ */

@media (max-width: 360px) {
    .login-card { padding: 20px 16px 18px; }
    .field-input-wrap input { padding: 12px 40px 12px 40px; font-size: 12px; }
    .btn-submit { min-height: 44px; padding: 12px; font-size: 13px; }
}

.help-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: rgb(61 99 168); color: #fff; border: none;
    font-size: 14px; font-weight: bold; cursor: pointer;
    vertical-align: middle; line-height: 1; padding: 0;
    margin-right: 8px; transition: opacity .2s;
}
.help-btn:hover { opacity: .8; }
.help-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5); z-index: 99999;
    display: flex; align-items: center; justify-content: center;
}
.help-box {
    direction: rtl; background: #fff; border-radius: 8px;
    width: 90%; max-width: 420px; max-height: 80vh;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    display: flex; flex-direction: column;
}
.help-box-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; border-bottom: 1px solid #eee;
}
.help-box-title { font-weight: 600; font-size: 15px; color: #222; }
.help-box-close {
    background: none; border: none; font-size: 22px;
    cursor: pointer; color: #888; line-height: 1; padding: 0;
}
.help-box-close:hover { color: #333; }
.help-box-body {
    padding: 18px; overflow-y: auto; flex: 1;
    font-size: 13px; line-height: 1.7; color: #444;
}
.help-box-footer {
    padding: 12px 18px; border-top: 1px solid #eee; text-align: left;
}
.help-box-btn {
    font-size: 13px; padding: 6px 18px; border: none;
    border-radius: 4px; cursor: pointer;
    background: #e0e0e0; color: #333;
    font-family: 'iransans';
}
.help-box-btn:hover { background: #ccc; }